package com.csce.domain.entity.score;

import cn.hutool.json.JSONUtil;
import com.osce.common.annotation.Excel;
import com.osce.common.core.entity.BaseEntity;
import lombok.*;

import java.util.List;

/**
 * 考试考场对象 score_ex_exam_place
 *
 * @author zzx
 * @since 2023-09-05
 */
@AllArgsConstructor
@NoArgsConstructor
@Data
@Builder
@ToString
@EqualsAndHashCode(callSuper = true)
public class ScoreExExamPlace extends BaseEntity {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    private Long id;

    /**
     * 考试编号
     */
    @Excel(name = "考试编号")
    private Long examId;

    /**
     * 考站个数
     */
    @Excel(name = "排队人数")
    private Integer waitNum;

    /**
     * 考站个数
     */
    @Excel(name = "考站个数")
    private Integer num;

    /**
     * 科室编号
     */
    @Excel(name = "科室编号")
    private Long deptId;

    /**
     * 技能编号
     */
    @Excel(name = "技能编号")
    private Long skillId;
    private String skillName;

    /**
     * 评分表编号
     */
    @Excel(name = "评分表编号")
    private String sheetId;
    private List<Long> sheetArr;
    private String sheetsStr;

    /**
     * 考站编号
     */
    @Excel(name = "考站编号")
    private Long placeId;
    private String placeName;


    /**
     * 前端传参使用
     */
    public void setSheetArr(List<Long> sheetId) {
        this.sheetId = JSONUtil.toJsonStr(sheetId);
        this.sheetArr = sheetId;
    }

    public List<Long> getSheetArr() {
        return JSONUtil.parseArray(sheetId).toList(Long.class);
    }

    public String getSheetId() {
        return sheetId;
    }

    public void setSheetId(String sheetId) {
        this.sheetId = sheetId;
        this.sheetArr = JSONUtil.parseArray(sheetId).toList(Long.class);
    }
}
